bitkeeper revision 1.1159.1.484 (41c1a3e20WEWxhNQDQK6avGv36pVEA)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 16 Dec 2004 15:04:02 +0000 (15:04 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 16 Dec 2004 15:04:02 +0000 (15:04 +0000)
Remove per vcpu misdirect virq support.

linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c
xen/common/domain.c
xen/common/event_channel.c
xen/include/xen/event.h

index 1a80279c2974fcc21929e4f6b5552695d3aee821..a9bb0e201b32f547ae8fccb2f6b5f76a8c09876d 100644 (file)
@@ -458,7 +458,6 @@ void local_setup_debug(void)
 }
 
 
-extern void setup_misdirect_virq(void);
 extern void local_setup_timer(void);
 
 /*
@@ -475,7 +474,6 @@ int __init start_secondary(void *unused)
        smp_callin();
        while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
                rep_nop();
-       setup_misdirect_virq();
        local_setup_timer();
        local_setup_debug();    /* XXX */
        smp_intr_init();
index 34ffb416b881196417c9248130b1b0dba3feec47..9501e3094b743880747f81f49d4b68aba31a34e3 100644 (file)
@@ -328,9 +328,6 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt)
     atomic_set(&ed->pausecnt, 0);
     shadow_lock_init(ed);
 
-    if ( (rc = init_exec_domain_event_channels(ed)) != 0 )
-        goto out;
-
     memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread));
 
     /* arch_do_createdomain */
index 017a27dc17a27c98e9fe60ddaabe23580baa04aa..bf5170c683c14b4cce961e57d97e1b5838186266 100644 (file)
@@ -259,8 +259,7 @@ static long evtchn_bind_virq(evtchn_bind_virq_t *bind)
      * bound yet. The exception is the 'misdirect VIRQ', which is permanently 
      * bound to port 0.
      */
-    if ( ((port = ed->virq_to_evtchn[virq]) !=
-          (ed->eid * EVENT_CHANNELS_SPREAD)) ||
+    if ( ((port = ed->virq_to_evtchn[virq]) != 0) ||
          (virq == VIRQ_MISDIRECT) ||
          ((port = get_free_port(ed)) < 0) )
         goto out;
@@ -355,8 +354,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     chn1 = d1->event_channel;
 
     /* NB. Port 0 is special (VIRQ_MISDIRECT). Never let it be closed. */
-    if ( (port1 <= 0) || (port1 >= d1->max_event_channel) ||
-         ((port1 & (EVENT_CHANNELS_SPREAD - 1)) == 0) )
+    if ( (port1 <= 0) || (port1 >= d1->max_event_channel) )
     {
         rc = -EINVAL;
         goto out;
@@ -641,31 +639,15 @@ long do_event_channel_op(evtchn_op_t *uop)
 }
 
 
-int init_exec_domain_event_channels(struct exec_domain *ed)
-{
-    struct domain *d = ed->domain;
-    int port, ret = -EINVAL, virq;
-
-    spin_lock(&d->event_channel_lock);
-    port = ed->eid * EVENT_CHANNELS_SPREAD;
-    if ( ((port < d->max_event_channel &&
-           d->event_channel[port].state != ECS_FREE)) ||
-         (get_free_port(ed) != port) )
-        goto out;
-    d->event_channel[port].state  = ECS_VIRQ;
-    d->event_channel[port].u.virq = VIRQ_MISDIRECT;
-    for ( virq = 0; virq < NR_VIRQS; virq++ )
-        ed->virq_to_evtchn[virq] = port;
-    ret = 0;
- out:
-    spin_unlock(&d->event_channel_lock);
-    return ret;
-}
-
 int init_event_channels(struct domain *d)
 {
     spin_lock_init(&d->event_channel_lock);
-    return init_exec_domain_event_channels(d->exec_domain[0]);
+    /* Call get_free_port to initialize d->event_channel */
+    if ( get_free_port(d->exec_domain[0]) != 0 )
+        return -EINVAL;
+    d->event_channel[0].state  = ECS_VIRQ;
+    d->event_channel[0].u.virq = VIRQ_MISDIRECT;
+    return 0;
 }
 
 
index 7410c0aa8c730b0c790f33f159211babf4d7ebdd..aa3d7092ae5c3ed7ad62f500219702bb9b29ad87 100644 (file)
@@ -57,7 +57,12 @@ static inline void evtchn_set_pending(struct exec_domain *ed, int port)
  */
 static inline void send_guest_virq(struct exec_domain *ed, int virq)
 {
-    evtchn_set_pending(ed, ed->virq_to_evtchn[virq]);
+    int port = ed->virq_to_evtchn[virq];
+
+    /* Always deliver misdirect virq's to exec domain 0. */
+    if ( unlikely(port == 0) )
+        ed = ed->domain->exec_domain[0];
+    evtchn_set_pending(ed, port);
 }
 
 /*